package com.mytaobao.main.firsttab.func.headline;

import android.content.Context;
import android.support.v4.app.Fragment;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.baseproject.adapter.ItemViewDelegate;
import com.baseproject.adapter.ViewHolder;
import com.mytaobao.R;
import com.mytaobao.util.Const;

/**
 * 淘宝头条
 */
public class HeadLineItemDelegate implements ItemViewDelegate<ItemHeadLine> {
    private final Fragment mFirstTabFragment;

    public HeadLineItemDelegate(Fragment fragment) {
        mFirstTabFragment = fragment;
    }

    @Override
    public int getItemViewLayoutId() {
        return R.layout.tao_bao_headline;
    }

    @Override
    public int getItemViewType() {
        return Const.TYPE_HEADLINE;
    }

    @Override
    public void convert(ViewHolder holder, int position) {

    }

    @Override
    public boolean onKeyDown(int keyCode, KeyEvent event) {
        return false;
    }

    @Override
    public ViewHolder createViewHolder(Context context, ViewGroup parent) {
        View itemView = LayoutInflater.from(context).inflate(getItemViewLayoutId(), parent, false);
        ViewHolder holder = new HeadLineViewHolder(context, itemView);
        return holder;
    }

    private final class HeadLineViewHolder extends ViewHolder {
        public HeadLineViewHolder(Context context, View itemView) {
            super(context, itemView);
        }
    }

    @Override
    public void updateData(ItemHeadLine itemHeadLine) {

    }

    @Override
    public int getItemCount() {
        return 1;
    }
}
